package com.ruoyi.web.controller.mall.menNeedType.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.controller.mall.menNeedType.domain.MenNeedType;
import com.ruoyi.web.controller.mall.menNeedType.service.IMenNeedTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 需求类型Controller
 * 
 * @author ruoyi
 * @date 2021-01-18
 */
@RestController
@RequestMapping("/mall/menNeedType")
public class MenNeedTypeController extends BaseController
{
    @Autowired
    private IMenNeedTypeService menNeedTypeService;

    /**
     * 查询需求类型列表
     */
    @PostMapping("/list")
    @ResponseBody
    public AjaxResult list()
    {
        MenNeedType menNeedType = new MenNeedType();
        menNeedType.setDelFlag(0);
        List<MenNeedType> list = menNeedTypeService.selectMenNeedTypeList(menNeedType);
        return AjaxResult.success(list);
    }

    /**
     * 新增保存需求类型
     */
//    @Log(title = "需求类型", businessType = BusinessType.INSERT)
//    @PostMapping("/add")
//    @ResponseBody
//    public AjaxResult addSave(MenNeedType menNeedType)
//    {
//        return toAjax(menNeedTypeService.insertMenNeedType(menNeedType));
//    }


    /**
     * 修改保存需求类型
     */
//    @Log(title = "需求类型", businessType = BusinessType.UPDATE)
//    @PostMapping("/edit")
//    @ResponseBody
//    public AjaxResult editSave(MenNeedType menNeedType)
//    {
//        return toAjax(menNeedTypeService.updateMenNeedType(menNeedType));
//    }

    /**
     * 删除需求类型
     */
//    @Log(title = "需求类型", businessType = BusinessType.DELETE)
//    @PostMapping( "/remove")
//    @ResponseBody
//    public AjaxResult remove(String[] id)
//    {
//        return toAjax(menNeedTypeService.deleteMenNeedTypeByIds(id));
//    }
}
